package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.entity.AddressInBean;
import com.example.demo.entity.AddressOutBean;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;


@RestController
@RequestMapping("api/address")
public class AddressController {
	
	@ApiOperation(value="获取地址信息",httpMethod="POST",notes="获取地址信息",consumes="application/json",produces="application/json")
	@ApiImplicitParam(name="request",value="getAddress",required=true,dataType="AddressInBean")
	@RequestMapping("/getAddress")
	public AddressOutBean getUser(@RequestBody AddressInBean request){
		AddressOutBean response=new AddressOutBean();
		if(request.getAddressId().equals("1")) {
			response.setAddressDetail("苏州");
		}else if(request.getAddressId().equals("2")) {
			response.setAddressDetail("南京");
		}else {
			response.setAddressDetail("常州");
		}
		return response;
	}

}
